You can use Jupyter Notebooks to write code and run it
To start a new Notebook go to File >> New Notebook
You can run code in a cell by clicking the arrow button next to the square stop button or typing Ctl (command) + Enter
You can start a new cell with Shift + Enter
There are lots of other buttons and commands. Try some of them.
In [ ]: